import blogsTable from '../db/blogsMock.js'
let fn_list = async (ctx, next) => {
    // 最后，想把它变成这样的使用
    ctx.render('blogs.html', {
        blogs: blogsTable
    })
}
let fn_getById = async (ctx, next) => {
    ctx.render('blogsAddOrEdit.html', {})
}
let fn_add = async (ctx, next) => {
    ctx.render('blogsAdd.html');
}
let fn_update = async (ctx, next) => {
    ctx.body = '修改博客'
}
let fn_del = async (ctx, next) => {
    ctx.body = '删除某个博客'
}


export const obj = {
    'get /blogs': fn_list,
    'get /blogs/:id': fn_getById,
    'post /blogs': fn_add,
    'put /blogs/:id': fn_update,
    'delete /blogs/:id': fn_del,
}